<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table border="1">
		<thead>
			<tr>
				<th>股票代码</th>
				<th>股票名称</th>
				<th>最新价格</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var = "stockbean" items="${list}">
			<tr>
				<td>
					<a href="javascript:void(0);" id="">${stockbean.getStocksModel().getStockCode()}</a>
				</td>
				<td>
					<a>${stockbean.getStocksModel().getStockName()}</a> 
				</td>
				<td>
					<a>${stockbean.getStocksModel().getStockPrice()}</a> 
				</td>
				<td>
					<a href="xxxxx.action">加入自选</a>
				</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<script src="assets/javascripts/jquery-3.2.1.js"></script>
	<script type="text/javascript">
		$('a').click(function getVal(){
			var stockCode = $(this).html();
			location.href="stockpage?stockCode="+stockCode;
		});
	</script>
</body>
</html>